package ac.svn.accesscontrol.poc;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;


public class AccessRightLoader 
{
	public static void main(String[] args)
	{
		Map<Integer, String> textMap = new HashMap<Integer, String>();
		try{
			// Open the file that is the first 
			// command line parameter
			FileInputStream fstream = new FileInputStream("D:\\MyDev\\TestCenter\\authz.txt");
			// Get the object of DataInputStream
			DataInputStream in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine;
			//Read File Line By Line
			int count = 0;
			while ((strLine = br.readLine()) != null)   {
				// Print the content on the console
				System.out.println (strLine);
				textMap.put(count++, strLine);
			}
			ArrayList<Integer> arrayList = new ArrayList<Integer>(textMap.keySet());
			Collections.sort(arrayList);
			
			
			
			//Close the input stream
			in.close();
		}catch (Exception e){//Catch exception if any
			System.err.println("Error: " + e.getMessage());
		}
	}
}
